<div id="in_scadenza">
  <h1>Scadenze</h1>
  <table>
    <tr>
    	<th></th>
	   	<th></th>
      <th>Cliente</th>
			<th>Scade tra</th>
      <th colspan="4">Comandi</th>
    </tr>
  <% for assistance in @today %>
		<% id = "quick_view2" + assistance.id.to_s %>
    <tr class="<%= cycle("even", "odd") %>">
			<% if assistance.urgency? %><td><%= image_tag("Urgent.gif") %></td><% else %><td></td><% end %>
    	<td><%= image_tag(assistance.stato_to_image) %></td>
      <td><%= truncate(assistance.client.name_or_society, 15) %></td>
			<td style="text-align: right"><%= assistance.expiration_from_now %></td>
			<td style="position: relative">
				<a href="#" onclick="try { Effect.toggle('<%= id %>','appear',{duration:0.5}); new Draggable('<%= id %>'); } catch (e) { alert('RJS error:\n\n' + e.toString()); alert('Effect.toggle(\'<%= id %>\',\'appear\',{duration:0.2});'); throw e }; return false;"><%= image_tag("eye.png", :alt => "quick view") %></a>
				<div id="<%= id %>" class="quick_view2" style="display: none;">
					<b>Descrizione: </b><%= assistance.short_desc %><br />
					<b>Note: </b><%= assistance.notes %><br />
					<b>Valore: </b><%= assistance.token_to_s %><br />
					<b>Resoconto: </b><%= assistance.confirm_to_s %><br />
					<b>Progressione: </b><%= assistance.num_ass %>a assistenza<br />
					<b>Operazioni: </b><br />
						<ul><% for operation in assistance.operations do %>
							<li><%= operation.description %></li>
						<% end %></ul>
				</div>
			</td>
      <td><%= link_to image_tag("info.png", :alt => "show"), assistance %></td>
      <td><%= link_to image_tag("edit.png", :alt => "edit"), edit_assistance_path(assistance) %></td>
      <td><%= link_to image_tag("delete.png", :alt => "delete"), assistance, :confirm => 'Sei sicuro?', :method => :delete %></td>
    </tr>
  <% end %>
  </table>
</div>
<div id="arretrate">
  <h1>Arretrate</h1>
  <table>
    <tr>
			<th></th>
			<th></th>
      <th>Cliente</th>
			<th>Scaduta da</th>
      <th colspan="4">Comandi</th>
    </tr>
  <% for assistance in @expired %>
		<% id = "quick_view3" + assistance.id.to_s %>
		<tr class="<%= cycle("even", "odd") %>">
    	<% if assistance.urgency? %><td><%= image_tag("Urgent.gif") %></td><% else %><td></td><% end %>
    	<td><%= image_tag(assistance.stato_to_image) %></td>
      <td><%= truncate(assistance.client.name_or_society, 14) %></td>
			<td style="text-align: right"><%= assistance.expiration_from_now %></td>
			<td style="position: relative">
				<a href="#" onclick="try { Effect.toggle('<%= id %>','appear',{duration:0.5}); new Draggable('<%= id %>'); } catch (e) { alert('RJS error:\n\n' + e.toString()); alert('Effect.toggle(\'<%= id %>\',\'appear\',{duration:0.2});'); throw e }; return false;"><%= image_tag("eye.png", :alt => "quick view") %></a>
				<div id="<%= id %>" class="quick_view3" style="display: none;">
					<b>Descrizione: </b><%= assistance.short_desc %><br />
					<b>Note: </b><%= assistance.notes %><br />
					<b>Valore: </b><%= assistance.token_to_s %><br />
					<b>Resoconto: </b><%= assistance.confirm_to_s %><br />
					<b>Progressione: </b><%= assistance.num_ass %>a assistenza<br />
					<b>Operazioni: </b><br />
						<ul><% for operation in assistance.operations do %>
							<li><%= operation.description %></li>
						<% end %></ul>
				</div>
			</td>
      <td><%= link_to image_tag("info.png", :alt => "show"), assistance %></td>
      <td><%= link_to image_tag("edit.png", :alt => "edit"), edit_assistance_path(assistance) %></td>
      <td><%= link_to image_tag("delete.png", :alt => "delete"), assistance, :confirm => 'Sei sicuro?', :method => :delete %></td>
    </tr>
  <% end %>
  </table>
</div>